import request from "@/common/Ask";
import type {Dept} from "@/interface/Dept";
import type {Query} from "@/interface/Query";
import type {Page} from "@/interface/Page";


export function oneIdApi(id : string) {
    return request<Dept>({
        url : '/dept/oneId/'+id,
        method : 'get'
    })
}

export function listApi(data : Query) {
    return request<Page<Dept>>({
        url : '/dept/list',
        method : 'post',
        data: data
    })
}

export function deleteApi(id : string) {
    return request<Dept>({
        url : '/dept/delete/' + id,
        method : 'delete',
    })
}


export function operatorApi(data : Dept) {
    return request<Dept>({
        url : '/dept/operator',
        method : 'put',
        data: data
    })
}

export async function treeNodeApi() {
    return request<Dept[]>({
        url: 'dept/treeNode',
        method: 'get'
    });
}
